package com.study.practice.secure;

import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;

/**
 * @Description : 安全随机数测试
 * @Version : V1.0.0
 * @Date : 2021/12/6 17:23
 */
public class SecureRandomTest {
    public static void main(String[] args) throws NoSuchAlgorithmException {
        System.out.println("start.....");
        long start = System.currentTimeMillis();
        SecureRandom random = SecureRandom.getInstanceStrong();
        for (int i = 0; i < 100; i++) {
            System.out.println("第 " + i + "个随机数.");
            random.nextInt(10000);
        }
        System.out.println("finish...time/ms:" + (System.currentTimeMillis() - start));
    }
}
